<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Data-Table 表格</title>
    <link rel="stylesheet" href="/web/layui/css/layui.css">
    <!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
    <link rel="stylesheet" href="/web/static/css/style.css">
    <link rel="stylesheet" href="/web/static/css/pro_list.css">
    <link rel="icon" href="/web/static/image/code.png">
</head>
<body class="body">

<!-- 工具集 -->
<div class="my-btn-box">
    <span class="fl">
        <a class="layui-btn btn-add btn-default" id="btn-add">添加产品</a>
        <a class="layui-btn btn-add btn-default" id="btn-refresh"><i class="layui-icon">&#x1002;</i></a>
    </span>
    {{--<span class="fr">--}}
         {{--<form class="layui-form" action="" onclick="return false">--}}

            {{--<div class="layui-form-item">--}}
                {{--<div class="layui-inline" id="search_status">--}}
                    {{--<label class="layui-form-label">会员状态</label>--}}
                    {{--<div class="layui-input-block">--}}
                        {{--<select  name="frozen_flag">--}}
                            {{--<option value="">-请选择-</option>--}}
                            {{--<option value="0">正常</option>--}}
                            {{--<option value="1">冻结</option>--}}

                        {{--</select>--}}
                    {{--</div>--}}
                {{--</div>--}}

                {{--<div class="layui-inline">--}}
                    {{--<label class="layui-form-label">手机号</label>--}}
                    {{--<div class="layui-input-inline">--}}
                        {{--<input type="tel" name="mobile" autocomplete="off" class="layui-input">--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<div class="layui-inline">--}}
                {{--<label class="layui-form-label">开始日期</label>--}}
                {{--<div class="layui-input-inline">--}}
                {{--<input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">--}}
                {{--</div>--}}
                {{--</div>--}}
                {{--<div class="layui-inline">--}}
                {{--<label class="layui-form-label">结束日期</label>--}}
                {{--<div class="layui-input-inline">--}}
                {{--<input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">--}}
                {{--</div>--}}
                {{--</div>--}}

                {{--<button class="layui-btn search" lay-submit lay-filter="search">查询</button>--}}
                {{--<button type="reset" class="layui-btn layui-btn-primary clear">清空</button>--}}
            {{--</div>--}}
        {{--</form>--}}
    {{--</span>--}}
</div>

<!-- 表格 -->
<div id="dateTable">

    <table class="layui-table" id="pro_data" lay-filter="pro_data"></table>

</div>


<!-- 表格操作按钮集 -->
<script type="text/html" id="barOption">
    <a class="layui-btn layui-btn-mini layui-btn-normal tool-btn" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-mini layui-btn-danger tool-btn" lay-event="del">删除</a>
</script>
</body>

<!-- 添加产品-->
<input type="hidden" name="_token" id="_token" value="<?php echo csrf_token(); ?>">
<div class="add_pro" >
    <form class="layui-form max-auto" action="" onclick="return false">
        <div class="layui-form-item">
            <label class="layui-form-label">套餐名称</label>
            <div class="layui-input-block">
                <input type="text" name="set_meal_name" required lay-verify="required" placeholder="请输入套餐名称"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">套餐类型</label>
            <div class="layui-input-block">
                <select name="type_id" lay-verify="required">
                    @if($data['product_type'])
                        @foreach($data['product_type'] as $k=>$v)
                            <option value='{{ $v['id'] }}'>{{ $v['set_meal_name'] }}  &nbsp;  &nbsp;</option >
                        @endforeach
                    @endif
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">时间类型</label>
            <div class="layui-input-block">
                <select name="time_type" lay-verify="required">
                    @if($data['time_type'])
                        @foreach($data['time_type'] as $k=>$v)
                            <option value='{{ $v['id'] }}'>{{ $v['time_name'] }}  &nbsp;  &nbsp;</option >
                        @endforeach
                    @endif
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">金额</label>
            <div class="layui-input-block">
                <input type="number" name="price" required lay-verify="required" placeholder="请输入金额"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">调取数量</label>
            <div class="layui-input-block">
                <input type="number" name="number" required lay-verify="required" placeholder="请输入调取数量"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">套餐天数</label>
            <div class="layui-input-block">
                <input type="number" name="date" required lay-verify="required" placeholder="请输入套餐天数"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="add_pro">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary btn-reset layui-layer-close">取消</button>
            </div>
        </div>
    </form>
</div>

<!-- 修改产品-->
<div class="edit_pro" >
    <form class="layui-form max-auto" action="" onclick="return false">
        <input type="hidden"  name="product_id" id="p_id" val="">
        <div class="layui-form-item">
            <label class="layui-form-label">套餐名称</label>
            <div class="layui-input-block">
                <input type="text" name="set_meal_name" id="set_meal_name" required lay-verify="required" placeholder="请输入套餐名称"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">套餐类型</label>
            <div class="layui-input-block">
                <select name="type_id" class="type_id" lay-verify="required">
                    @if($data['product_type'])
                        @foreach($data['product_type'] as $k=>$v)
                            <option value='{{ $v['id'] }}'>{{ $v['set_meal_name'] }}  &nbsp;  &nbsp;</option >
                        @endforeach
                    @endif
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">时间类型</label>
            <div class="layui-input-block">
                <select name="time_type" class="time_type" lay-verify="required">
                    @if($data['time_type'])
                        @foreach($data['time_type'] as $k=>$v)
                            <option value='{{ $v['id'] }}'>{{ $v['time_name'] }}  &nbsp;  &nbsp;</option >
                        @endforeach
                    @endif
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">金额</label>
            <div class="layui-input-block">
                <input type="number" name="price" id="price" required lay-verify="required" placeholder="请输入金额"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">调取数量</label>
            <div class="layui-input-block">
                <input type="number" name="number" id="number" required lay-verify="required" placeholder="请输入调取数量"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">套餐天数</label>
            <div class="layui-input-block">
                <input type="number" name="date" id="date" required lay-verify="required" placeholder="请输入套餐天数"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="上线" >
                <input type="radio" name="status" value="0" title="下线" >
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="edit_pro">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary layui-layer-close">取消</button>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript" src="/web/layui/layui.js"></script>
<script type="text/javascript" src="/web/index.js"></script>
<script type="text/javascript" src="/web/static/js/product/pro_list.js"></script>

</html>